project(access)


add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/person-odb.hxx
        ${CMAKE_CURRENT_SOURCE_DIR}/person-odb.cxx
        PRE_BUILD
        COMMAND echo "-----acess---------"
        COMMAND odb -d mysql --generate-query --generate-schema person.hxx
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

#过滤文件
file(GLOB source
        "*.hxx"
        "*.cxx"
        )





add_executable(${PROJECT_NAME} ${source})

target_link_libraries(${PROJECT_NAME}
        PRIVATE ${ODB_LIBRARY_VAR}
        PRIVATE  ${ODB_MYSQL_LIBRARY_VAR})